home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Developer Utilities / Installer 4.0GM SDK / Script Examples / File Search Procedure / File Search Proc.r < prev    next >
Encoding:
Text File  |  1994-02-10  |  1.8 KB  |  87 lines  |  [TEXT/MPS ]

  1. #include "InstallerTypes.r"
  2.  
  3. include "FindTargetFile";
  4.  
  5. //  This script is set up to use a custom version proc to determine whether
  6. //  or not to replace/update an existing file.
  7. //  This is the recommended way of determining whether or not to update an
  8. //  existing file.
  9.  
  10. //  If the correct flags are set, Installer will compare the 'vers' 1 resource
  11. //  the existing target file with the version hard-coded in the 'infa'
  12. //  of the source file.
  13.  
  14. //  The following flags must be set:
  15. //        copy, useSrcCrDateToCompare, leaveAloneIfNewer, & update existing.
  16. //  also the 'infa' must have the source version hard-coded in BCD format.
  17.  
  18.  
  19. resource 'inpk' (100) {
  20.     format0 {
  21.         showsOnCustom,
  22.         removable,
  23.         dontForceRestart,
  24.         0,
  25.         13555,
  26.         "Replace all copies of TeachText on the select disk",
  27.         {    'infa', 1000    },
  28.         }
  29.     };
  30.  
  31. resource 'infa' (1000) {
  32.     format1 {
  33.         deleteWhenRemoving,
  34.         deleteWhenInstalling,
  35.         copy,                            //  Copy on Install
  36.         dontIgnoreLockedFile,
  37.         dontSetFileLocked,
  38.         useVersProcToCompare,            //  Use default version proc for compare
  39.         srcNeedExist,
  40.         rsrcForkInRsrcFork,
  41.         leaveAloneIfNewer,                //  Do not update a newer file
  42.         updateExisting,                    //  Update an existing file
  43.         copyIfNewOrUpdate,
  44.         rsrcFork,
  45.         dataFork,
  46.         0,
  47.         0x0,
  48.         10000,
  49.         {    20000, 0, 0    },
  50.         0,                                //  The source version number in BCD format
  51.         0,
  52.         0,
  53.         "Read Me"
  54.         }
  55.     };
  56.  
  57.  
  58. resource 'intf' (10000) {
  59.     format0 {
  60.         searchForFile,
  61.         TypeCrNeedNotMatch,
  62.         'APPL',
  63.         'ttxt',
  64.         200,
  65.         ":TeachText"
  66.         }
  67.     };
  68.  
  69. resource 'infs' (20000) {
  70.     'APPL',
  71.     'ttxt',
  72.     0x1,
  73.     noSearchForFile,
  74.     TypeCrMustMatch,
  75.     "Tidbits:Apple Utilities:TeachText"            //  System 7.1 Tidbits FDHD diskette
  76.     };
  77.  
  78. resource 'insp' (200) {
  79.     format0 {
  80.         'infn',                // Code Rsrc Type
  81.         401,                // Code Rsrc ID
  82.         0,                    // RefCon
  83.         20000,                // Min Required Memory
  84.         "Searching for all TeachText applications test."    // Summary
  85.         }
  86.     };
  87.